#ifndef ALIEN_ATTACK_LEVELPARSER_H
#define ALIEN_ATTACK_LEVELPARSER_H

#include <iostream>
#include <vector>
#include <tinyxml.h>

struct Level;
struct Tileset;
struct Layer;
struct TileLayer;

struct LevelParser
{
    Level *parserLevel(const char *stateFile);

private:
    void parserTexture(TiXmlElement *pTextureRoot);
    void parseTilesets(TiXmlElement *pTilesetRoot,
                       std::vector<Tileset> *pTilesets);
    void parseObjectLayer(TiXmlElement *pObjectElement,
                          std::vector<Layer *> *pLayers, Level *pLevel);
    void parseTileLayer(TiXmlElement *pTileElement, std::vector<Layer *> *pLayers,
                        const std::vector<Tileset> *pTilesets,
                        std::vector<TileLayer *> *pCollisionLayers);

    int m_tileSize;
    int m_width;
    int m_height;
};

#endif // header file protect